Class_name = "CTurret"
object_name = "_M4A2_T2"

AimingRay=true

[COCKPIT_LIMITS]
x= -0.15, 0.10
y= -0.2, 0.06
z= -0.27, 0.15
[END]

[OPEN_COCKPIT_LIMITS]
x= -0.1, 0.3
y= -0.08, 0.1
z= -0.25, 0.25
[END]

VisualImage=0,"graphics\Vehicles\_M4A2\_M4A2-C3-low.mgm",true
VisualImage=1,"graphics\Vehicles\_M4A2\_M4A2-C3.mgm",8
CollisionBody="graphics\Vehicles\_M4A2\_M4A2-C3.col"
HitBody="graphics\Vehicles\_M4A2\_M4A2-C3_DetColl.col"
KeepNetworkImages=true	//high-poly cockpit will be visible from other workstations of the object

//VisualImage=ID,model_or_effect,cast_shadows[,debris_effects]
//ID:					INT:	0 - visible everywhere, 1 - visible inside, 2 - visible outside
//model_or_effect:		STRING:	path to model file (mgm) of effect file (epl)
//cast_shadows: 		BOOL/INT:	cast shadows from object or not (cast_shadows=Attr1+Attr2+...+AttrN)
//						VIF_CASTSHADOWS=1,
//						VIF_BLENDMASKLAST=2,
//						VIF_ALWAYSONTOP=4,
//						VIF_FLATAMBIENT=8,
//[,debris_effects]:	BOOL:	optional parameter, show effects on object debris or not

ImageAttr=1	//IA_NOCLIP
//	IA_DEFAULT=0,
//	IA_NOCLIP=1,
//	IA_NOCLIP_ANIM=2,
//	IA_NOROTINTERPOLATION=4,
//	IA_NOMINZ=8,
//	IA_NOMINPIXELS=16,
//	IA_NOPOSINTERPOLATION=32,
//	IA_CLOSEVIEWARG=64,
//	IA_ALWAYSVISIBLE=128,
//	IA_SCALEARG=256,
//	ImageAttr=Attr1+Attr2+...+AttrN

TransparentCockpit=false	// If false - Attached bot will be not rendered if cockpit hatch is closed (default =true)

//LocalPosRot=true
ConvexAnimThreshold=0.000001	//  

VisualRadius=5.0

mp_site=true

TurretType = 13	//    ,    (, )
//11 -  
//12 -  
//13 -  

[attach=0]
	object = "LuaScripts/WorldObjects/Bots/BotTankM4A2_MGunner.txt"
	position = 0,0,0
	convex="bot_pos",false	//false: Attach object relative to "bot_pos" convex (not absolute)
[end]

[attach=1]
	position = 0.0, 0.0, 0.0
	object = "LuaScripts/WorldObjects/TurretRiffle.txt"
[end]

[attach=2]
	position = 0,0,0
	rotation = 0, 0, 8
	object = "LuaScripts/WorldObjects/TurretCameraTankByAttach.txt"
	convex="gunsight0",false	//false: Attach object relative to "gunsight0" convex (not absolute)
[end]

TargetingScript = "LuaScripts/WorldObjects/Ballistics/Projectiles/BULLET_RUS_7-62x54_AP.bin"

SoundScript="LuaScripts/Sound/Vehicles/M4A2_FP_Turret_T2.cfg"

Script="LuaScripts\ObjectScripts\Vehicles\_M4A2_T2.sc"

//FetchArgVal= cockpit_arg_num, transfer_number, default_cockpit_arg_val, interpolation_type (clamp - shortest on line scale, wrap - shortest on cyclic scale)

AimAngleLimit=10

[TurretsPos=0]
	position = 1.88865,1.48926,0.50964
	PosMoveArg = 21000

	ReloadDelay = 0.3
	BotRotaionValueZ = 0.0	//-2.0
	LegsParameter = 0.0
	BotMinFirstAngle  = -90
	BotMaxFirstAngle  = 90
	BotMinSecondAngle = -90
	BotMaxSecondAngle = 90
	FirstToSecondInterp = 0.0

	LockTurretCamera=true

	// Joints in orientation order!!!

	[Joint=0]
		SectorAngleMin = -21.0
		SectorAngleMax = 21.0

		AngularSpeed   = 60.0
		PrecisionAngle = 1

		AnimationArgMin = 0.383333
		AnimationArgMax = 0.616667

		AnimationArgNum = 21006

		Point = 0,0,0
		Axis = 0.0,1.0,0.0

		SoundNumber = 2
	[end]

	[Joint=1]
		SectorAngleMin = -21.0
		SectorAngleMax = 10.0
		
		AngularSpeed   = 60.0
		PrecisionAngle = 1

		AnimationArgMin = 0.383333
		AnimationArgMax = 0.555556

		AnimationArgNum = 21002

		Point = 0,0,0
		Axis  = 0.0, 0.0, 1.0

		SoundNumber = 1

		NoMoveFar=true	// Block rotation when the target is in the rear henisphere
	[end]

	[GunAnimation=0]
		FireArg = 60320
	[end]

//	FireLightArg=60220

	relativeBotStand = 0.0, 0.0, 0.0 // not used for tank
	relativeBotSit = 0.0, 0.0, 0.0 // not used for tank
	relativeBotDead = 0.0, 0.0, 0.0 // not used for tank
	TransitionStandPower = 1 // not used for tank
	TransitionDeadPower = 1 // not used for tank

	BotAttachJointId = 0
	BotFirstAnimJointId = 1
	BotSecondAnimJointId  = 0

	SightPosition = 0.0, 1, 0.0

	defaultDirection = 1.0, 0.0, 0.0
	AimSector=-21, 21, -10, 21	//AI aim limits: left, right, down, up

	CamDisplacement = -0.89,0.3,0
[end]

[TurretsGun=0]
	LinkedTurretPos = 0
	//Convex = "#mg3"
	DGroup="MachineGun"
	DamageProp = 0.001

	Displacement = 0.3906,0,0
	GunsightPosition = 0.3906,0,0
	GunType = "LuaScripts/WorldObjects/Weapons/_M1919.txt"
	ParallaxDistance = 1000000.0

	ReLoadingStagesTime = 1.0, 3.0, 1.0, 0.3
 
	ReservedMagazinesArgIdx = 9008
//	FlashAnimationArgIdx = 60320
	TriggerPositionArgIdx = 9001
	RoundsInMagazineArgIdx = 9009
	AmmunitionMovingArgIdx = 9005
	HideAmmunitionArgIdx = 9010
	ReLoadingArgIdx = 9011
	AzimuthDeviationArgIdx = 9006
	ElevationDeviationArgIdx = 9007
//	FiringPinPositionArgIdx = 0			// not used
	DrawAnimationArgIdx = 2, 9003		// 

	Deviation = 0.67, 2.1, 0.0, 0.01, 0.03, 0.06  //0.8333   , 3.3333   ,    .  840/
	// /:
	//-      , /
	//-      , /
	//-       (0.9 -    0.1  ,   )
	//-    
	//-     
	//-      100/

	NumOfAnimations = 4

//	BushCoord = -0.114461, 0.0436303, -0.0287316
//	BushSpeed = 0.944, -0.096, -0.316

//	BushConfig = "LuaScripts/WorldObjects/Trash/Batch_case07-08mm.txt"

	SoundNumber = 3
[end]

[Ammunition0]
	GunAmmunition0=0
[end]
[GunAmmunition0]
	MaxRoundsInMagazine = 250
	RoundsInMagazine = 250
	MaxReservedMagazines = 18
	ReservedMagazines = 18
	MaxMisFiresInMagazine = 0
	AmountRoundsWithOneTracer = 4
	ParallaxConfig="LuaScripts/WorldObjects/Ballistics/Projectiles/BULLET_USA_7-62x63_AP.bin"
	BulletConfig = "LuaScripts/WorldObjects/Ballistics/Projectiles/BULLET_USA_7-62x63_AP.txt"
[end]

SightPos = 0.0, 1.3, 0.0
PositionChangeTime = 0.5
StandDuration = 1.0
SitDuration = 1.0
PreEjectDuration = 1.0
FreezeOnReload = false
AutoRecharge = false

GunSightDistanceArg = 9544
GunSightYawArg = 9546
GunSightTypeArg = 9545

//   ,         
//SectorLimits =  -45.0,  +45.0,  25.0, 90.0
//SectorLimits =	-180.0, -140.0, -15.0, 90.0
//SectorLimits =	 140.0,  180.0, -15.0, 90.0

// Damage

//BeamHitZeroArmor=true //      m_fArmor  m_fArmorSides ( ,       )
//LifeRate=5000
//LifeRateFrag=5000 
//Firing=0.005
//Armor=60
//[ArmorBox]			//    ,     ,   ,     Armor=
//	FovH=90			//          ,     ,  ArmorFront
//	FovV=90			//          ,     ,  ArmorFront
//					//  5        
//	ArmorFront=75
//	ArmorBack=60
//	ArmorTop=30
//	ArmorBottom=30
//	ArmorRight=60
//	ArmorLeft=60
//[end]

//maxDamageArgValue=0.98
//DamageArg=5000
damageablePart=""

IsCritical=false	//true -       
LifeK=100			//         ( -  )

KillChildObjectsOnParentDeath = true

SphereHitProtection=38	//  /     

[SphereProtectionBoxOpen]	//    ,        ,   ,     SphereHitProtection=
	FovH=120					//          ,     ,  ArmorFront
	FovV=90					//          ,     ,  ArmorFront
							//  5        
	ArmorFront=70
	ArmorBack=0
	ArmorTop=0
	ArmorBottom=20
	ArmorRight=0
	ArmorLeft=0
[end]

[SphereProtectionBoxClose]	//    ,        ,   ,     SphereHitProtection=
	FovH=90					//          ,     ,  ArmorFront
	FovV=150				//          ,     ,  ArmorFront
							//  5        
	ArmorFront=89
	ArmorBack=38
	ArmorTop=19
	ArmorBottom=20
	ArmorRight=38
	ArmorLeft=38
[end]

////	Energy loss for bullet travel through HitBody convices	////

energyloss="",true,1,200	//     , true -       -,       ,        
energyloss="#mg3",true,5,20000		//Machinegun
energyloss="top_1h",false,20,1		//Machinegunner houses roof armouring, 27mm, K=0.8
energyloss="sight_1051",false,1,1	//Machinegunner visor glass
energyloss="sight_1053",false,1,1	//Machinegunner visor glass


//Graphical Damage Groups:

[DGroup=MachineGun]
	IsCritical=false
	LifeK=20
	convex="#mg3",5,10000,"MT_ARMOR"
	[SphereHitArmorBox]
		FovH=170
		FovV=90
		ArmorFront=5
		ArmorBack=100
		ArmorTop=5
		ArmorBottom=30
		ArmorRight=5
		ArmorLeft=5
	[end]
	LifeRateFrag=5000
	RepairSpeed=0.002083	// (8 )
	RepairSource=0
	InstantRepair=true
	GuiParam=19, true,true,true
[end]
[DGroup=Body]		//   _KV1s.txt     DGroup
	IsCritical=true
	LifeK=200
	DamageArg=5000
	MinValidLife=0.02
[end]

[DGroup=Visor1]
	IsCritical=false
	LifeK=2	
	convex="sight_1051",1,500,"MT_ARMOR"
	SphereHitProtection=8		//   -      
	[SphereHitArmorBox]			//    ,        ,   ,     SphereHitProtection=
		FovH=60		
		FovV=20					//          ,     ,  ArmorFront
								//  5        
		ArmorFront=1
		ArmorBack=8
		ArmorTop=8
		ArmorBottom=30
		ArmorRight=8
		ArmorLeft=8
	[end]
	LifeRateFrag=5000
	Shield=0.0
	DamageArg=1051
	DamageMaxVal=1.0
	SmokeArg=0
	SmokeDec=0.02
	RepairSpeed=0.033333	// (0.5 )
	RepairSource=0
	InstantRepair=true
	GuiParam=11, true,true,true
[end]
[DGroup=Visor2]
	IsCritical=false
	LifeK=2	
	convex="sight_1053",1,500,"MT_ARMOR"
	SphereHitProtection=8		//   -      
	[SphereHitArmorBox]			//    ,        ,   ,     SphereHitProtection=
		FovH=60		
		FovV=20					//          ,     ,  ArmorFront
								//  5        
		ArmorFront=1
		ArmorBack=8
		ArmorTop=8
		ArmorBottom=30
		ArmorRight=8
		ArmorLeft=8
	[end]
	LifeRateFrag=5000
	Shield=0.0
	DamageArg=1053
	DamageMaxVal=1.0
	SmokeArg=0
	SmokeDec=0.02
	RepairSpeed=0.033333	// (0.5 )
	RepairSource=0
	InstantRepair=true
	RepairDependsOn="Visor1", 0.95
	GuiParam=11, true,true,true
[end]

//End of Functional Damage Groups

[Entrance]
	EntrancePos= 1.2, 1.0, 1.9
	EntranceRot= 0,45,0
	JumpDir= 0,0,0
[end]

ColimatorHideArg=9547

//DefaultGun=0	//default=-1, all of the guns are active, switching belts in gun 0. >=0 sets default gun and switshing will be between guns

ClosedHatch=false					// True -    
ClosedWindow=false					// True -    
NoAimingWhenOpened=false			// True -      
NoAimingWhenClosed=false			// True -      
DenyDisabledTurretCamera=true		// True -         
CanopyOpenByDefault=false
WindowOpenByDefault=false
canopytime=3.5625	//   Arg=0  Arg=0.95.     Arg=0.1  Arg=0.9     (3 ),    0.95/0.8*5=3.5625.
windowtime=2

OpenCockpitArg=30
AutoCanopy=false
CockpitLightArg=30000,0.25,0.251,0.6
canopyLockSoundMask=2 	// 0 bit - canopy unlock, start
						// 1 bit - canopy unlock, end
						// 2 bit - canopy lock, start
						// 3 bit - canopy lock, end

OpenWindowArg=31
AutoWindow=false
WindowLightArg=30010,0.6,0.45,0.6

TechChatCrewRole=9	//    (Driver: 1, Gunner: 3, Commander: 5, Machinegunner: 7, Radioman: 9)

SetCockpitArgs=true	// true -             , false -              

//CockpitArg= FetchType, CmdID, SubcmdID, ArgNum, ArgValDefault, SmoothingType, SmoothingPower, NetworkFlag
//FetchType=-1:       
//FetchType=-2:         
//FetchType=-3:          parent-
//FetchType>=0:          child-   Attach ID
//CmdID=[0..999]: ID    ,    .
//CmdID=[1000..1999]: ID    ,    .
//SubcmdID=[0..3]: ID     .
//SubcmdID=[0..1]: ID     .
//ArgNum:     / .
//ArgValDefault:      ,    .
//SmoothingType: smooth_clamp -  - 
//SmoothingType: smooth_wrap -   
//SmoothingPower:   
//NetworkFlag="":           ,  SetCockpitArgs=false
//NetworkFlag="low_freq":     ,       ,    
//NetworkFlag="med_freq":     ,       ,    
//NetworkFlag="high_freq":     ,       ,    
//NetworkFlag="granted_single":     ,       ,     

CockpitArg = -3, 0000, 0, 60210, 0.0, "smooth_clamp", 0.0, ""			// Electric point lights
CockpitArg = -3, 0000, 1, 60310, 0.0, "smooth_clamp", 0.0, ""			// Electric flood light

CockpitArg = -2, 0100, 0, 9008, 0.0, "", 0.0, "granted_single"			// ReservedMagazinesArgIdx

CockpitArg = -2, 0150, 0, 9001, 0.0, "smooth_clamp", 0.1, "med_freq"	// TriggerPositionArgIdx, gun1
CockpitArg = -2, 0150, 1, 9009, 0.0, "smooth_wrap", 0.1, "med_freq"		// RoundsInMagazineArgIdx, gun1
CockpitArg = -2, 0150, 2, 9010, 0.0, "", 0.0, "med_freq"				// HideAmmunitionArgIdx, gun1
CockpitArg = -2, 0150, 3, 9011, 0.0, "smooth_wrap", 0.1, "med_freq"		// ReLoadingArgIdx, gun1

VisorYawMin=-45
VisorYawArgMin=0.25
VisorYawMax=+45
VisorYawArgMax=0.75
VisorYawArg=40
VisorYawDefault=0
VisorYawSpeed=0.25
VisorPitchMin=-35
VisorPitchArgMin=0.305556
VisorPitchMax=+10
VisorPitchArgMax=0.555556
VisorPitchDefault=-8.0
VisorPitchArg=35
VisorPitchSpeed=0.25
VisorResetWhileAim=false
VisorResetIfOpened=true
PrecisionAngle=2	//Rotation stop smoothing

[moveBotDeviator]
  HiFreqAmp = 0.2f
  MaxDeviation = 0.3f
  Periods = 2.1, 0.4;
[end]
accelBotDirK = 0.2
accelBotDirSmooth = 0.03
accelBotSideK = 0.2
accelBotSideSmooth = 0.03